<html>
<head><meta charset="utf-8"><title>datafrog statistics · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html">datafrog statistics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="154766656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154766656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154766656">(Jan 09 2019 at 23:32)</a>:</h4>
<p>I finished updating the statistics PR to output a CSV file, is <a href="https://github.com/rust-lang-nursery/datafrog/pull/21" target="_blank" title="https://github.com/rust-lang-nursery/datafrog/pull/21">this</a> more what you had in mind <span class="user-mention" data-user-id="116009">@nikomatsakis</span> ? (I would like to add a test before merging, using tempdir/tempfile for example)</p>



<a name="154854044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154854044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154854044">(Jan 10 2019 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> looks about right, yep!</p>



<a name="154855670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154855670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154855670">(Jan 10 2019 at 17:18)</a>:</h4>
<p>re: your comment; yeah it will dump the stats as it goes. We talked about maybe keeping the stats in memory and printing the CSV after the computation is done (maybe when the iteration is dropped), and we can switch to this model if you want ? It seems nice but probably more valuable in different cases than this one: say, when the collecting/collating is performance intensive or the stats are more complicated -- whereas here it's just dumping the data and it didn't seem extremely necessary.</p>



<a name="154855686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154855686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154855686">(Jan 10 2019 at 17:19)</a>:</h4>
<p>But at the same time, I'd still like to collect timing stats per variable (the duration the different operators took; if needed, under a feature flag) and this will require the other model, so maybe I should do it now ?</p>



<a name="154864289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154864289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154864289">(Jan 10 2019 at 19:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> I'm not sure that collecting "in memory" is particularly useful. I think this approach you outlined looks good as a start to me. Timing information might be useful too but that'll be a bit trickier I guess</p>



<a name="154864421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154864421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154864421">(Jan 10 2019 at 19:25)</a>:</h4>
<p>I'd be game to land the PR as is</p>



<a name="154864451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154864451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154864451">(Jan 10 2019 at 19:26)</a>:</h4>
<p>alright thanks, do we want to try and add a little test to this ? (I did once add some timing by threading Durations around Relations, that seemed to work ok I guess)</p>



<a name="154882897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154882897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154882897">(Jan 11 2019 at 00:11)</a>:</h4>
<p>(disclaimer, I don't know this code) Aren't these compatible outcomes? Have a </p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">Stats</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">begin</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">log_one</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">end</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>And implement it 2x:</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="w"> </span><span class="n">Stats</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Immediate</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">log_one</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">eprintln</span><span class="o">!</span><span class="p">(...)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">Stats</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Rollup</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">log_one</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">stats</span><span class="p">.</span><span class="n">push</span><span class="p">(...)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">end</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* final compute and print */</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="154900451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/datafrog%20statistics/near/154900451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/datafrog.20statistics.html#154900451">(Jan 11 2019 at 07:52)</a>:</h4>
<p>oh yeah, not really incompatible per se, it was mostly a question of whether it was useful to have both or the rollup at all</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>